package com.yiquan.search.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;

/**
 * 实体类
 *
 * @author Administrator
 */
@Data
@Document(indexName = "yiquan_user",type = "user")
public class User implements Serializable {


    @Id
    private Long id;//

    //    @JsonSerialize(using = ToStringSerializer.class)
    private Long user_id;//用户id
    private String username;//用户名
    private String password;//登录密码
    private String phone;
    private String nick_name;
    private Integer sex;//性别
    private String region;// 地区
    private String avatar;//头像
    private String background;
    private String profile;// 简介
    private java.util.Date birthday;//生日
    private Integer fan_nums;
    private Integer works_nums;
    private Integer follow_nums;

    private String status; //状态 0正常 1异常
    private String user_type;//用户类型  N：普通用户 T：教师 O：机构 A：后台管理员
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date create_date;//账号创建时间

    @Transient
    private Integer thumbs;



}
